package com.ruoyi.until;

import lombok.Data;

import java.io.Serializable;

/**
 * @author: liufei
 * @Desc:
 * @create: 2024-10-21 09:18
 **/
@Data
public class R implements Serializable {

    private String msg;

    private Integer code;

    private Boolean flag;

    private Object data;

    public static R ok (){
        R r = new R();
        r.setFlag(true);
        r.setCode(200);
        r.setMsg("操作成功");
        return r;
    }

    public static R ok (Object data){
        R r = new R();
        r.setFlag(true);
        r.setCode(200);
        r.setMsg("操作成功");
        r.setData(data);
        return r;
    }

    public static R error (String msg){
        R r = new R();
        r.setFlag(false);
        r.setCode(500);
        r.setMsg(msg);
        return r;
    }


}
